﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Planer.Model.Validators.Base;

namespace Planer.Model.Validators
{
    public class BillingValidator : Validator<billing>
    {
        public override void Validate(billing Bill)
        {
            if (Bill == null) throw new ArgumentNullException("Bill", NULL_ARGUMENT_MESSAGE);

            NameValidator nameValidator = new NameValidator();
            nameValidator.Validate(Bill.name);

            if (nameValidator.Status == OperationStatusType.ERROR)
            {
                this.status = OperationStatusType.ERROR;
                this.Errors.AddRange(nameValidator.Errors);
            }
        }
    }
}
